#include <stdio.h>
#include "app_task.h"
#include "bsp_init.h"
#include "FreeRTOS.h"
#include "task.h"
#include "hc32_ll.h"
#include "diode.h" 
#include "vi5300.h"
#include "gpio.h" 
#include "adc.h" 
#include "i2c.h"
#include "led.h"
#include "appControl.h"

//device1_5
int main(void)
{
	LL_PERIPH_WE(LL_PERIPH_ALL); 
	BSP_CLK_Init();
//	debug_Uart3_Init(); 
  	debug_Uart1_Init();
	diodeInit();
	gpioLedConfig();
	adcInit();
	gpioShakeConfig();
	
	i2c1Init();
	vi5300IsExistFlag = vi5300Init();
	
	ledcontralred();
	DDL_DelayMS(400);
	ledcontralgreen();
	DDL_DelayMS(400);
	ledcontralblue();
	DDL_DelayMS(400);
	ledcontralblack();
	
	LL_PERIPH_WP(LL_PERIPH_ALL);
	//printf("\nSysten Begin \r\n");
	BaseType_t xReturn = pdPASS;	
	xReturn = xTaskCreate((TaskFunction_t)appTaskCreate,(const char *)"appTaskCreate",\
		(uint16_t)128,(void*)NULL,(BaseType_t)1,(TaskHandle_t*)&appTaskCreate_Handle);
	if(pdPASS == xReturn)//任务创建成功
	{
		vTaskStartScheduler();
	}
	else
	{
		return -1;
	}
	while(1)
	{;}
}	

/************

*************/
